package com.pets.vo;

import com.alibaba.fastjson.JSONObject;

/**
 * 实名认证返回结果VO
 */
public class IdCardResultVO {
    /**
     * 用户传递上来真实姓名脱敏返回
     */
    private String realName;

    /**
     * 用户传递上来IdcardNo的脱敏返回
     */
    private  String idCard;

    /**
     * true：匹配 false：不匹配
     */
    private  boolean isok;

    /**
     * 身份证信息
     */
    private IdCardInfoVO idCardInfo;

    public String getRealName() {
        return realName;
    }

    public void setRealName(String realName) {
        this.realName = realName;
    }

    public String getIdCard() {
        return idCard;
    }

    public void setIdCard(String idCard) {
        this.idCard = idCard;
    }

    public boolean isIsok() {
        return isok;
    }

    public void setIsok(boolean isok) {
        this.isok = isok;
    }

    public IdCardInfoVO getIdCardInfo() {
        return idCardInfo;
    }

    public void setIdCardInfo(IdCardInfoVO idCardInfo) {
        this.idCardInfo = idCardInfo;
    }

    public static IdCardResultVO fill(JSONObject jsonObject){
        IdCardResultVO IdCardResultVO = new IdCardResultVO();
        if(jsonObject.containsKey("realname")){
            IdCardResultVO.setRealName(jsonObject.getString("realname"));
        }
        if(jsonObject.containsKey("idcard")){
            IdCardResultVO.setIdCard(jsonObject.getString("idcard"));
        }
        if(jsonObject.containsKey("isok")){
            IdCardResultVO.setIsok(jsonObject.getBoolean("isok"));
        }

        return IdCardResultVO;
    }
}
